import subprocess
import sys


def main(args):
    # 可用'--cfg-options'来重写配置文件中的参数
    command = f"python /home/jacy/PyPjs/detection/mmyolo/tools/train.py " \
              f"/home/jacy/GDW/data_{args[1]}/yolov8_s_syncbn_fast_8xb16-500e_coco.py " \
              f"--work-dir /home/jacy/GDW/data_{args[1]}/model"

    try:
        subprocess.run(command, shell=True, check=True)
    except subprocess.CalledProcessError as e:
        print(f"Error occurred:{e}")


if __name__ == '__main__':

    main(sys.argv)